$(function() {
	$('#vue_vm_list div').hide();
	
	var loginedUser = getLoginedUser();
	findBySubjectRoomId(loginedUser.subjectRoomId);
});

function findBySubjectRoomId(subjectRoomId) {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();

	find_basic_by_json(path+'/cgIndiServiceSendOrder/findBySubjectRoomId', {subjectRoomId: subjectRoomId}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				finish:function(cgIndiServiceSendOrderId) {
					save_basic_by_json(path+'/cgIndiServiceSendOrder/finish', {id:cgIndiServiceSendOrderId}, function() {
						$('#' + cgIndiServiceSendOrderId + '_status').text('状态：已结束');
						$('#' + cgIndiServiceSendOrderId + '_finish').hide();
						alert('结束成功');
					});
				}
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/cgIndiServiceSendOrder/deleteBatch');
}
